home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 34.zip
/
BS1 part 34
/
megadisc PD 13.adf
/
PROGRAMS
/
tinybmap
< prev
next >
Wrap
Text File
|
1989-05-22
|
3KB
|
149 lines
CLS
startit:
LOCATE 8,15:PRINT "1. Load BMAP"
LOCATE 10,15:PRINT "2. Quit"
LOCATE 12,15:INPUT "Select one ", A
ON A GOSUB loadbmap,endit
GOTO startit
loadbmap:
bmap.name$=""
lib.name$=""
subname$=""
q$=CHR$(34)
CLS
startload:
PRINT
PRINT "Name (including pathname) of desired"
INPUT "bmap to load ";b$
IF RIGHT$(b$,5) <> ".bmap" THEN
PRINT
PRINT "Spelling is incorrect or file is misnamed. A bmap file NAME"
PRINT "must end with " + q$ + ".bmap" + q$ + "."
GOTO startload
END IF
OPEN b$ FOR INPUT AS 1
bmap$=INPUT$(LOF(1),1)
CLOSE 1
namelength%=LEN(b$)
startpoint%=namelength%-5
rf$=""
rev$=""
control%=100
WHILE control% > 96 AND control% < 123 AND startpoint% > 0
rf$=MID$(b$,startpoint%,1)
control%=ASC(rf$)
rev$=rev$ + rf$
startpoint%=startpoint%-1
WEND
revlen%=LEN(rev$)
test%=ASC(RIGHT$(rev$,1))
IF test% > 96 OR test% <123 THEN
rev$=LEFT$(rev$,revlen%-1)
END IF
n$=""
FOR x%=revlen% TO 1 STEP -1
n$=n$+MID$(rev$,x%,1)
NEXT
bmap.name$=n$+".bmap"
lib.name$=n$+".library"
subname$= n$+".MSB"
GetRoutine bmap$,lib.name$,bmap.name$,subname$
NewCycle
RETURN
endit:
MENU RESET
END
RETURN
SUB GetRoutine (bmap$,LIB$,BN$,S$) STATIC
CLS
start:
routine$=""
FD$=""
q$=CHR$(34)
PRINT
PRINT "Name of first "+LIB$+" routine"
INPUT "you wish to use ";routine$
IF routine$="" THEN start
again:
FD$=FD$+"fd$=fd$+" + q$ + routine$ + q$
FD$=FD$+ " + chr$(0)" + CHR$(10)
routine$=routine$+CHR$(0)
offset%=INSTR(bmap$,routine$)
IF offset%=0 THEN
PRINT "I can't find this routine"
PRINT "Check spelling."
GOTO start
END IF
length%=LEN(routine$)
count%=offset%+length%
FD$=FD$+"fd$=fd$+"
char$=""
WHILE char$<>CHR$(0)
char$=MID$(bmap$,count%,1)
FD$=FD$+"chr$("+STR$(ASC(char$)) + ")" + "+"
count%=count%+1
WEND
newlength%=LEN(FD$)-1
FD$=LEFT$(FD$,newlength%)
FD$=FD$+CHR$(10)
PRINT
PRINT "Thank you. Next routine?"
INPUT "(if none press RETURN) ",routine$
IF routine$="" THEN
GOTO goon
ELSEIF routine$=CHR$(127) THEN
GOTO start
ELSE
GOTO again
END IF
goon:
final.length%=LEN(FD$)-1
FD$=LEFT$(FD$,final.length%)
PRINT
INPUT "name of destination file ";destfile$
IF destfile$="" THEN goon
F$=" FOR OUTPUT AS 1"
OPEN destfile$ FOR OUTPUT AS 1
PRINT #1,""
PRINT #1,"SUB " + S$ + " STATIC"
PRINT #1,FD$
PRINT #1,"OPEN " + q$ + "RAM:" + BN$ + q$ + F$
PRINT #1,"PRINT #1,FD$;"
PRINT #1,"CLOSE 1"
PRINT #1,"LIBRARY " + q$ + "RAM:" + LIB$ + q$
PRINT #1,"END SUB"
CLOSE 1
END SUB
SUB NewCycle STATIC
CLS
LOCATE 4,1
q$=CHR$(34)
PRINT "If you wish to use routines from another LIBRARY select"
PRINT q$ + "Load bmap" + q$ + " from menu."
END SUB